#!/bin/bash
j="jdbc:oracle:thin:@192.168.3.69:1521/ORCL"
u="dw"
p="123456"
t="SYS_USER_INFO"
t1="ORG_INFO"
echo "--------------开始导出数据到oracle--------------"
echo "------------------开始导出SYS_USER_INFO表------------------"
sqoop export \
--connect ${j} \
--username ${u} \
--password ${p} \
--table ${t} \
--export-dir /user/hive/warehouse/dw.db/sys_user_info \
--fields-terminated-by ',' \
--lines-terminated-by '\n' \
--input-null-string '\\N' \
--input-null-non-string '\\N' 
echo "-----------SYS_USER_INFO表已导出完成--------"
echo "------------------开始导出ORG_INFO表------------------"
sqoop export \
--connect ${j} \
--username ${u} \
--password ${p} \
--table ${t1} \
--export-dir /user/hive/warehouse/dw.db/org_info \
--fields-terminated-by ',' \
--lines-terminated-by '\n' \
--input-null-string '\\N' \
--input-null-non-string '\\N' 
echo "-----------ORG_INFO表已导出完成--------"